package com.itheima;

import java.io.Serializable;

//用户类
public class User implements Serializable {
    private String userName; //用户名
    private String sex; //性别
    private String ip; //用户IP
    private int age; //年龄
    private boolean admin; //true是管理员，false不是管理员

    public User() {
    }

    public User(String userName, String sex, String ip, int age, boolean admin) {
        this.userName = userName;
        this.sex = sex;
        this.ip = ip;
        this.age = age;
        this.admin = admin;
    }

    /**
     * 获取
     * @return userName
     */
    public String getUserName() {
        return userName;
    }

    /**
     * 设置
     * @param userName
     */
    public void setUserName(String userName) {
        this.userName = userName;
    }

    /**
     * 获取
     * @return sex
     */
    public String getSex() {
        return sex;
    }

    /**
     * 设置
     * @param sex
     */
    public void setSex(String sex) {
        this.sex = sex;
    }

    /**
     * 获取
     * @return ip
     */
    public String getIp() {
        return ip;
    }

    /**
     * 设置
     * @param ip
     */
    public void setIp(String ip) {
        this.ip = ip;
    }

    /**
     * 获取
     * @return age
     */
    public int getAge() {
        return age;
    }

    /**
     * 设置
     * @param age
     */
    public void setAge(int age) {
        this.age = age;
    }

    /**
     * 获取
     * @return admin
     */
    public boolean isAdmin() {
        return admin;
    }

    /**
     * 设置
     * @param admin
     */
    public void setAdmin(boolean admin) {
        this.admin = admin;
    }

    public String toString() {
        return "User{userName = " + userName + ", sex = " + sex + ", ip = " + ip + ", age = " + age + ", admin = " + admin + "}";
    }
}
